<?php

class StockController extends CController {
    public function actions() {
        return array(
            'quote' => array(
                'class' => 'CWebServiceAction',
            ),
        );
    }
    /**
     * @param string the symbol of the stock
     * @return float the stock price
     * @soap
     */
    public function getPrice($symbol) {
        $prices = array('IBM' => 100, 'GOOGLE' => 350);

        return isset($prices[$symbol]) ? $prices[$symbol] : 0;
        //...return stock price for $symbol
    }

    /**
     * @param string
     * @return mixed
     * @soap
     */
    public function testData($data) {
        $arr = array(
            0 => 'test 111',
            1 => 'test 222'
        );

        return $arr[$data];
    }
}